<template>
  <div class="error-container">
    <div class="error-content">
      <el-row :gutter="20">
        <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
          <div class="pic-error">
            <img alt="401" class="pic-error-parent" src="@/assets/images/401.png" />
          </div>
        </el-col>
        <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
          <div class="bullshit">
            <div class="bullshit-oops">401!</div>
            <div class="bullshit-headline">抱歉，您无权访问该页面...</div>
            <div class="bullshit-info">您没有访问该资源的权限，请联系管理员或返回首页</div>
            <a class="bullshit-return-home" href="/">返回首页</a>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script setup>
// 401 页面不需要特殊逻辑
</script>

<style lang="scss" scoped>
.error-container {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #f0f2f5;
  overflow: hidden;
}

.error-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 1200px;
}

.pic-error {
  position: relative;
  float: left;
  width: 100%;
  overflow: hidden;
  
  &-parent {
    width: 100%;
  }
}

.bullshit {
  position: relative;
  float: left;
  width: 100%;
  padding: 30px 0;
  overflow: hidden;
  
  &-oops {
    font-size: 32px;
    font-weight: bold;
    line-height: 40px;
    color: #f56c6c;
    opacity: 0;
    margin-bottom: 20px;
    animation-name: slideUp;
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
  }
  
  &-headline {
    font-size: 20px;
    line-height: 24px;
    color: #222;
    font-weight: bold;
    opacity: 0;
    margin-bottom: 10px;
    animation-name: slideUp;
    animation-duration: 0.5s;
    animation-delay: 0.2s;
    animation-fill-mode: forwards;
  }
  
  &-info {
    font-size: 13px;
    line-height: 21px;
    color: grey;
    opacity: 0;
    margin-bottom: 30px;
    animation-name: slideUp;
    animation-duration: 0.5s;
    animation-delay: 0.4s;
    animation-fill-mode: forwards;
  }
  
  &-return-home {
    display: block;
    float: left;
    width: 110px;
    height: 36px;
    background: #f56c6c;
    border-radius: 100px;
    text-align: center;
    color: #ffffff;
    opacity: 0;
    font-size: 14px;
    line-height: 36px;
    cursor: pointer;
    animation-name: slideUp;
    animation-duration: 0.5s;
    animation-delay: 0.6s;
    animation-fill-mode: forwards;
    text-decoration: none;
  }
  
  @keyframes slideUp {
    0% {
      transform: translateY(60px);
      opacity: 0;
    }
    100% {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

@media screen and (max-width: 768px) {
  .pic-error {
    margin-bottom: 30px;
  }
}
</style>